package com.meilingcloud.research.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.meilingcloud.biobank.domain.SampleBackup;
import com.meilingcloud.common.annotation.Excel;
import com.meilingcloud.system.domain.SysAttach;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 课题任务 对象 rws_task
 *
 * @author chenl
 * @date 2021-03-23
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("rws_task")
public class RwsTask implements Serializable {

    private static final long serialVersionUID = 1L;


    /**
     * 任务ID
     */
    @TableId(value = "task_id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long taskId;

    /**
     * 课题ID
     */
    @Excel(name = "课题ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long topicId;

    /**
     * 任务名称
     */
    @Excel(name = "任务名称")
    private String taskName;

    /**
     * 任务描述
     */
    @Excel(name = "任务描述")
    private String taskDesc;

    /**
     * 任务状态
     */
    @Excel(name = "任务状态")
    private String taskState;

    /**
     * 删除标志
     */
    @TableLogic(value = "0", delval = "1")
    private String delFlag;

    /**
     * 创建者
     */
    private String createBy;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 更新者
     */
    private String updateBy;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 附件列表
     */
    @TableField(exist = false)
    private List<SysAttach> attaches;

    /**
     * 关联样本复份
     */
    @TableField(exist = false)
    private List<SampleBackup> sampleBackups;

    @TableField(exist = false)
    private Map<String, Object> params = new HashMap<>();
}
